<?php

namespace App\Modules\Admin\Services\Order;

use App\Library\Junda\src\Consumption;
use App\Modules\Admin\Entities\Water\WaterOrderModel;

class WaterOrderRefundServices
{

    protected static $instance;
    /**
     * 实例化
     * @param array $config
     * @return static
     */
    public static function instance(array $config = [])
    {
        if (is_null(self::$instance)) {
            self::$instance = new static($config);
        }
        return self::$instance;
    }

    public function getWaterOrderList()
    {



        $start_time =  date("Y-m-d H:i:s", strtotime("-2 hour"));
        $end_time =   date("Y-m-d H:i:s", strtotime("-12 hour"));

        $order_list =  WaterOrderModel::getInstance()->getOrderLists();

        exit(json_encode($order_list));
        foreach ($order_list as $order){
            $order_sn = $order['order_sn'];
            $res_junda = Consumption::GetPayConsumeByOrderNo($order_sn);
            $IsConsumed = $res_junda['data']['IsConsumed'];
            if ($IsConsumed){
                // 有订单

                exit(json_encode($res_junda['data']['IsConsumed']));
            }else{
                //无订单

                exit(json_encode($res_junda['data']['IsConsumed']));

            }
        }
    }
}
